#ifndef STANDARDDATABASEDELEGATE_H
#define STANDARDDATABASEDELEGATE_H

#include "combo-box-delegate.h"

class AbstractDatabaseClient;
class AbstractQueries;
class ModelResult;

class StandardDatabaseDelegate : public ComboBoxDelegate
{
    Q_OBJECT
public:
    explicit StandardDatabaseDelegate(QObject *parent = 0);

public slots:
    virtual void setDatabaseClient(QSharedPointer<AbstractDatabaseClient> databaseClient);
    virtual void setLoadingParameters(const QVariantList& parameters);
    virtual void setLoadingParameter(const QVariant &parameter);
    virtual void setNullIncluded (bool included);
    virtual void initialize();

signals:
    void initialized();

protected slots:
    virtual void finishInitialize(ModelResult *result);
    virtual void setupInternalModel (QAbstractTableModel* model);

protected:
    QSharedPointer<AbstractDatabaseClient> m_databaseClient;
    QVariantList m_loadingParameters;
    AbstractQueries* m_queries;
    bool m_nullIncluded;
};

#endif // STANDARDDATABASEDELEGATE_H
